//
//  TyrionApi.swift
//  Pods
//
//  Created by eme on 2017/4/1.
//
//
import Foundation
import Alamofire
import ModelProtocol
import NetWorkCore
import UtilCore

/*
 owner:cy
 update:2017年04月01日17:23:11
 info: 众筹模块api
 
 */

public enum JaimeApi{
    /// 店铺众筹商城首页
    case opShopCorwdfunding
    ///商城首页 最新上线,即将开始,即将结束
    case shopindexcorwdfunding(page: Int, length: Int,flag:String)
}
extension JaimeApi: TargetType {
    //设置请求路径
    public var path: String {
        switch self {
        case .opShopCorwdfunding:
            return "/opShopCorwdfunding/index.json"
        case .shopindexcorwdfunding:
            return "/opShopCorwdfunding/shopindexcorwdfunding.json"
        }
    }
    //设置请求方式 get post等
    public var method: HTTPMethod {
        switch self {
        default :
            return .post
        }
    }
    /// 设置请求参数
    public var parameters: Parameters? {
        switch self {
        case let .shopindexcorwdfunding(page, length,flag):
            return ["page":page,"length":length,"flag":flag]
        default :
            return nil
        }
    }
    
}
